home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / include / X11 / Xaw / TextSrc.h < prev    next >
C/C++ Source or Header  |  2006-04-12  |  7KB  |  281 lines

  1. /*
  2.  * $Xorg: TextSrc.h,v 1.4 2001/02/09 02:03:47 xorgcvs Exp $
  3.  */
  4.  
  5. /***********************************************************
  6.  
  7. Copyright 1987, 1988, 1994, 1998  The Open Group
  8.  
  9. Permission to use, copy, modify, distribute, and sell this software and its
  10. documentation for any purpose is hereby granted without fee, provided that
  11. the above copyright notice appear in all copies and that both that
  12. copyright notice and this permission notice appear in supporting
  13. documentation.
  14.  
  15. The above copyright notice and this permission notice shall be included in
  16. all copies or substantial portions of the Software.
  17.  
  18. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  19. IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  20. FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL THE
  21. OPEN GROUP BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN
  22. AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
  23. CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
  24.  
  25. Except as contained in this notice, the name of The Open Group shall not be
  26. used in advertising or otherwise to promote the sale, use or other dealings
  27. in this Software without prior written authorization from The Open Group.
  28.  
  29.  
  30. Copyright 1987, 1988 by Digital Equipment Corporation, Maynard, Massachusetts.
  31.  
  32.                         All Rights Reserved
  33.  
  34. Permission to use, copy, modify, and distribute this software and its 
  35. documentation for any purpose and without fee is hereby granted, 
  36. provided that the above copyright notice appear in all copies and that
  37. both that copyright notice and this permission notice appear in 
  38. supporting documentation, and that the name of Digital not be
  39. used in advertising or publicity pertaining to distribution of the
  40. software without specific, written prior permission.  
  41.  
  42. DIGITAL DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING
  43. ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL
  44. DIGITAL BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR
  45. ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS,
  46. WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION,
  47. ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS
  48. SOFTWARE.
  49.  
  50. ******************************************************************/
  51. /* $XFree86: xc/lib/Xaw/TextSrc.h,v 1.11 2001/01/17 19:42:35 dawes Exp $ */
  52.  
  53. #ifndef _XawTextSrc_h
  54. #define _XawTextSrc_h
  55.  
  56. #include <X11/Xaw/Text.h>
  57.  
  58. /* Resources:
  59.  
  60.  Name             Class        RepType        Default Value
  61.  ----             -----        -------        -------------
  62.  callback         Callback        Callback    NULL
  63.  editType         EditType        XawTextEditType    XawtextRead
  64.  enableUndo         Undo        Boolean        False
  65.  sourceChanged         Changed        Boolean        False
  66.  
  67. */
  68.  
  69. /* Class record constants */
  70. extern WidgetClass textSrcObjectClass;
  71.  
  72. typedef struct _TextSrcClassRec *TextSrcObjectClass;
  73. typedef struct _TextSrcRec      *TextSrcObject;
  74.  
  75. typedef enum {
  76.     XawstPositions,
  77.     XawstWhiteSpace,
  78.     XawstEOL,
  79.     XawstParagraph,
  80.     XawstAll,
  81.     XawstAlphaNumeric
  82.   } XawTextScanType;
  83.  
  84. typedef enum {
  85.     Normal,
  86.     Selected
  87. } highlightType;
  88.  
  89. typedef enum {
  90.     XawsmTextSelect,
  91.     XawsmTextExtend
  92. } XawTextSelectionMode;
  93.  
  94. typedef enum {
  95.     XawactionStart,
  96.     XawactionAdjust,
  97.     XawactionEnd
  98. } XawTextSelectionAction;
  99.  
  100. #define XawTextReadError -1
  101. #define XawTextScanError -1
  102.  
  103. #ifndef OLDXAW
  104. #define XtNenableUndo        "enableUndo"
  105. #define XtCUndo            "Undo"
  106.  
  107. #define XtNsourceChanged    "sourceChanged"
  108. #define XtCChanged        "Changed"
  109.  
  110. #define XtNpropertyCallback    "propertyCallback"
  111. #endif
  112.  
  113. /*
  114.  * Public Functions
  115.  */
  116. _XFUNCPROTOBEGIN
  117.  
  118. /*
  119.  * Function:
  120.  *    XawTextSourceRead
  121.  *
  122.  * Parameters:
  123.  *    w      - TextSrc Object
  124.  *    pos    - position of the text to retreive
  125.  *    text   - text block that will contain returned text
  126.  *    length - maximum number of characters to read
  127.  *
  128.  * Description:
  129.  *    This function reads the source.
  130.  *
  131.  * Returns:
  132.  *    The number of characters read into the buffer
  133.  */
  134. XawTextPosition XawTextSourceRead
  135. (
  136.  Widget            w,
  137.  XawTextPosition    pos,
  138.  XawTextBlock        *text_return,
  139.  int            length
  140.  );
  141.  
  142. /*
  143.  * Function:
  144.  *    XawTextSourceReplace
  145.  *
  146.  * Parameters:
  147.  *    src     - Text Source Object
  148.  *    startPos - ends of text that will be removed
  149.  *    endPos     - ""
  150.  *    text     - new text to be inserted into buffer at startPos
  151.  *
  152.  * Description:
  153.  *    Replaces a block of text with new text
  154.  *
  155.  * Returns:
  156.  *    XawEditError or XawEditDone
  157.  */
  158. int XawTextSourceReplace
  159. (
  160.  Widget            w,
  161.  XawTextPosition    start,
  162.  XawTextPosition    end,
  163.  XawTextBlock        *text
  164.  );
  165.  
  166. /*
  167.  * Function:
  168.  *    XawTextSourceScan
  169.  *
  170.  * Parameters:
  171.  *    w     - TextSrc Object
  172.  *    position - position to start scanning
  173.  *    type     - type of thing to scan for
  174.  *    dir     - direction to scan
  175.  *    count     - which occurance if this thing to search for
  176.  *    include     - whether or not to include the character found in
  177.  *           the position that is returned. 
  178.  *
  179.  * Description:
  180.  *    Scans the text source for the number and type of item specified.
  181.  *
  182.  * Returns:
  183.  *    The position of the text
  184.  */
  185. XawTextPosition XawTextSourceScan
  186. (
  187.  Widget            w,
  188.  XawTextPosition    position,
  189. #if NeedWidePrototypes
  190.  int            type,
  191.  int            dir,
  192.  int            count,
  193.  int            include
  194. #else
  195.  XawTextScanType    type,
  196.  XawTextScanDirection    dir,
  197.  int            count,
  198.  Boolean        include
  199. #endif
  200.  );
  201.  
  202. /*
  203.  * Function:
  204.  *    XawTextSourceSearch
  205.  *
  206.  * Parameters:
  207.  *    w     - TextSource Object
  208.  *    position - position to start scanning
  209.  *    dir     - direction to search
  210.  *    text     - the text block to search for
  211.  *
  212.  * Description:
  213.  *    Searchs the text source for the text block passed.
  214.  *
  215.  * Returns:
  216.  *    The position of the text we are searching for or XawTextSearchError
  217.  */
  218. XawTextPosition XawTextSourceSearch
  219. (
  220.  Widget            w,
  221.  XawTextPosition    position,
  222. #if NeedWidePrototypes
  223.  int            dir,
  224. #else
  225.  XawTextScanDirection    dir,
  226. #endif
  227.  XawTextBlock        *text
  228.  );
  229.  
  230. /*
  231.  * Function:
  232.  *    XawTextSourceConvertSelection
  233.  *
  234.  * Parameters:
  235.  *    w      - TextSrc object
  236.  *    selection - current selection atom
  237.  *    target      - current target atom
  238.  *    type      - type to conver the selection to
  239.  *    value      - return value that has been converted
  240.  *    length      - ""
  241.  *    format      - format of the returned value
  242.  *
  243.  * Returns:
  244.  *    True if the selection has been converted
  245.  */
  246. Boolean XawTextSourceConvertSelection
  247. (
  248.  Widget            w,
  249.  Atom            *selection,
  250.  Atom            *target,
  251.  Atom            *type,
  252.  XtPointer        *value_return,
  253.  unsigned long        *length_return,
  254.  int            *format_return
  255.  );
  256.  
  257. /*
  258.  * Function:
  259.  *    XawTextSourceSetSelection
  260.  *
  261.  * Parameters:
  262.  *    w      - TextSrc object
  263.  *    left      - bounds of the selection
  264.  *    right      - ""
  265.  *    selection - selection atom
  266.  *
  267.  * Description:
  268.  *    Allows special setting of the selection.
  269.  */
  270. void XawTextSourceSetSelection
  271. (
  272.  Widget            w,
  273.  XawTextPosition    start,
  274.  XawTextPosition    end,
  275.  Atom            selection
  276.  );
  277.  
  278. _XFUNCPROTOEND
  279.  
  280. #endif /* _XawTextSrc_h */
  281.